<!DOCTYPE html>













<html class="theme-next gemini" lang="zh-CN">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"/>
<meta name="theme-color" content="#222">












<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=6.4.2" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=6.4.2">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico?v=6.4.2">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico?v=6.4.2">


  <link rel="mask-icon" href="/images/logo.svg?v=6.4.2" color="#222">









<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '6.4.2',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    fastclick: false,
    lazyload: false,
    tabs: true,
    motion: {"enable":false,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  





  <meta name="description" content="形式化概念 图$G$是一个二元组$(V,E)$。 其中$V$称为顶点集，$E$称为边集，它们亦可写成 $V(G)$和$E(G)$。 $E$的元素是一个二元组数对，用$(x,y)$表示，其中$x,y\in V$。">
<meta name="keywords" content="ZROI,图论">
<meta property="og:type" content="article">
<meta property="og:title" content="ZROI十一重庆Day3-图论概览">
<meta property="og:url" content="https://sshwy.gitee.io/2018/10/04/51508/index.html">
<meta property="og:site_name" content="Sailor&#39;s Blog">
<meta property="og:description" content="形式化概念 图$G$是一个二元组$(V,E)$。 其中$V$称为顶点集，$E$称为边集，它们亦可写成 $V(G)$和$E(G)$。 $E$的元素是一个二元组数对，用$(x,y)$表示，其中$x,y\in V$。">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2018-11-17T15:41:31.898Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="ZROI十一重庆Day3-图论概览">
<meta name="twitter:description" content="形式化概念 图$G$是一个二元组$(V,E)$。 其中$V$称为顶点集，$E$称为边集，它们亦可写成 $V(G)$和$E(G)$。 $E$的元素是一个二元组数对，用$(x,y)$表示，其中$x,y\in V$。">






  <link rel="canonical" href="https://sshwy.gitee.io/2018/10/04/51508/"/>



<script type="text/javascript" id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>ZROI十一重庆Day3-图论概览 | Sailor's Blog</title>
  









  <noscript>
  <style type="text/css">
    .use-motion .motion-element,
    .use-motion .brand,
    .use-motion .menu-item,
    .sidebar-inner,
    .use-motion .post-block,
    .use-motion .pagination,
    .use-motion .comments,
    .use-motion .post-header,
    .use-motion .post-body,
    .use-motion .collection-title { opacity: initial; }

    .use-motion .logo,
    .use-motion .site-title,
    .use-motion .site-subtitle {
      opacity: initial;
      top: initial;
    }

    .use-motion {
      .logo-line-before i { left: initial; }
      .logo-line-after i { right: initial; }
    }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Sailor's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <h1 class="site-subtitle" itemprop="description">Amorphophalms konjac Oier</h1>
      
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">
    <a href="/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-home"></i> <br />首页</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-about">
    <a href="/about/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-user"></i> <br />关于</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-links">
    <a href="/links/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-sitemap"></i> <br />友情链接</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">
    <a href="/archives/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />归档</a>
  </li>

      
      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />搜索</a>
        </li>
      
    </ul>
  

  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://sshwy.gitee.io/2018/10/04/51508/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="sshwy">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Sailor's Blog">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">ZROI十一重庆Day3-图论概览
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">

            
            
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2018-10-04 08:41:00" itemprop="dateCreated datePublished" datetime="2018-10-04T08:41:00+08:00">2018-10-04</time>
            

            
              

              
                
                <span class="post-meta-divider">|</span>
                

                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2018-11-17 23:41:31" itemprop="dateModified" datetime="2018-11-17T23:41:31+08:00">2018-11-17</time>
              
            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/算法/" itemprop="url" rel="index"><span itemprop="name">算法</span></a></span>

                
                
                  ，
                
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/算法/图论/" itemprop="url" rel="index"><span itemprop="name">图论</span></a></span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="形式化概念"><a href="#形式化概念" class="headerlink" title="形式化概念"></a>形式化概念</h2><ul>
<li>图$G$是一个二元组$(V,E)$。</li>
<li>其中$V$称为顶点集，$E$称为边集，它们亦可写成 $V(G)$和$E(G)$。</li>
<li>$E$的元素是一个二元组数对，用$(x,y)$表示，其中$x,y\in V$。<a id="more"></a>
</li>
</ul>
<h2 id="分类"><a href="#分类" class="headerlink" title="分类"></a>分类</h2><p>图含有多个分类的标签：</p>
<ul>
<li>有向/无向（Directed/Undirected）</li>
<li>有环/无环（Ring/Acyclic）</li>
<li>联通/非联通（Unicom/Non-Unicom）</li>
<li>简单/多重（Simple/Multiple）</li>
<li>加权（Weighted）</li>
</ul>
<p>常见图结构：</p>
<ul>
<li>有向无环图（Directed Acyclic Graph，DAG）</li>
<li>无向无环图（Undirected Acyclic Graph）——无根树（Unrooted Tree）</li>
<li>简单图（Simple Graph，不包含重边和自环）</li>
<li>多重图（Multi-Graph，可能包含重边和自环）</li>
<li>加权图（Weighted Graph，通常指边带权）</li>
</ul>
<h2 id="图的存储"><a href="#图的存储" class="headerlink" title="图的存储"></a>图的存储</h2><p>图的存储大体分邻接矩阵，邻接表，链式前向星三种。</p>
<table>
<tr><td>方式</td><td>存储</td><td>空间复杂度</td><td>边的存在性判断</td><td>边的遍历</td></tr><tr><td>邻接矩阵<br></td><td>二维数组</td><td>$O(v^2)$</td><td>$O(1)$</td><td>$O(v)$</td></tr><tr><td>邻接表</td><td>vector或二维数组</td><td>$O(v+e)或者o(v^2)$</td><td>$O(e)$</td><td>$O(e)$</td></tr><tr><td>链式前向星</td><td>结构体</td><td>$O(e)$</td><td>$O(e)$</td><td>$O(e)$</td></tr>
</table>

<h2 id="玄学的度"><a href="#玄学的度" class="headerlink" title="玄学的度"></a>玄学的度</h2><h3 id="度-形式化概念"><a href="#度-形式化概念" class="headerlink" title="度-形式化概念"></a>度-形式化概念</h3><ul>
<li><p><strong>无向图</strong>中，定义$dg()$表示节点的<strong>度</strong>，则 $\forall v \in V(G)$ ,</p>
<script type="math/tex; mode=display">dg(v)=\sum_{u \in V(G)}[\ ((u,v)\in E(G))\vee((v,u)\in E(G))\ ]</script></li>
<li><p><strong>有向图</strong>的节点分入度（$idg()$）和出度（$odg()$）： $\forall v \in V(G)$ ,</p>
<script type="math/tex; mode=display">idg(v)=\sum_{u\in V(G)}[(u,v)\in E(G)] \\ odg(v)=\sum_{u\in V(G)}[(v,u)\in E(G)]</script></li>
</ul>
<h3 id="度序列-Sequence-Degree"><a href="#度序列-Sequence-Degree" class="headerlink" title="度序列-Sequence Degree"></a>度序列-Sequence Degree</h3><h4 id="度序列-形式化定义"><a href="#度序列-形式化定义" class="headerlink" title="度序列-形式化定义"></a>度序列-形式化定义</h4><ul>
<li>对于 $V(G)=\left \{ v_1,v_2,\cdots ,v_p \right \}$ ，则称<strong>非负整数</strong>序列 $\left \{ dg(v_1),dg(v_2),\cdots ,dg(v_p) \right \}$ 为图G的<strong>度序列</strong>.</li>
<li><strong>简单图</strong>的度序列称为<strong>图序列</strong>.</li>
</ul>
<h4 id="前置定理：-forall-G-V-E-sum-v-in-V-d-v-2-V-G"><a href="#前置定理：-forall-G-V-E-sum-v-in-V-d-v-2-V-G" class="headerlink" title="前置定理：\forall G=(V,E),\sum_{v\in V}d(v)=2|V(G)|"></a>前置定理：<script type="math/tex">\forall G=(V,E),\sum_{v\in V}d(v)=2|V(G)|</script></h4><ul>
<li>推论1：任何图中,奇点的个数为偶数.</li>
<li>推论2：<strong>非负整数序列</strong> $A=\left \{ a_1,{a_2},\cdots,a_p \right \}$ 是某个图的<strong>度序列</strong>,当且仅当$\sum_{i=1}^na_i$是偶数.</li>
</ul>
<h4 id="Erdos-Gallai定理"><a href="#Erdos-Gallai定理" class="headerlink" title="Erdos-Gallai定理"></a>Erdos-Gallai定理</h4><p>序列 $A$ 是<strong>图序列</strong>当且仅当：</p>
<ul>
<li>$A$ 是度序列（见<strong>前置定理-推论2</strong>）</li>
<li>$p-1\geq a_1\geq a_2\geq \cdots \geq a_p$.</li>
<li>$\forall k\in[1,p-1] ,  \sum_{i=1}^ka_i\leq\sum_{i=k+1}^pmin(k,a_i)+k(k-1)$</li>
</ul>
<h3 id="序列可图性"><a href="#序列可图性" class="headerlink" title="序列可图性"></a>序列可图性</h3><h4 id="可图（化）-定义"><a href="#可图（化）-定义" class="headerlink" title="可图（化）-定义"></a>可图（化）-定义</h4><ul>
<li>一个序列是某个无向图的<strong>度序列</strong>，则该序列是可图的，也称该序列<strong>可图化</strong>。</li>
<li>进一步，一个序列是某个无向图的<strong>图序列</strong>，称该序列可<strong>简单图化</strong>。</li>
</ul>
<h4 id="Havel-Hakimi定理"><a href="#Havel-Hakimi定理" class="headerlink" title="Havel-Hakimi定理"></a>Havel-Hakimi定理</h4><ul>
<li>对于<strong>非递增</strong>序列 $A=\left \{ a_1,{a_2},\cdots,a_p \right \}$</li>
<li>$A$ 可简单图化，当且仅当：<script type="math/tex; mode=display">\mathbf{A'=\left\{ a_2-1,a_3-1,\cdots,a_{a_1+1}-1,a_{a_1+2},a_{a_1+3},\cdots,a_n \right\}}</script>可简单图化.</li>
</ul>
<h5 id="分析-amp-简略的感性证明"><a href="#分析-amp-简略的感性证明" class="headerlink" title="分析&amp;简略的感性证明"></a>分析&amp;简略的感性证明</h5><ul>
<li>先分析 $A’$ 的结构：<ul>
<li>一共有 $n-1$ 个元素，比 $A$ 少了一个 $a_1$</li>
<li>前 $a_1$ 个数都减了1，后面有 $n-a_1-1$ 个数不变。</li>
</ul>
</li>
<li>从序列 $A$ 中产生 $A’$，相当于将 $A$ 对应的无向图中度为 $a_1$ 的点删除（并且把与这个点连接的边也删掉），这样相当于删除了元素 $a_1$ ，又让其他的 $a_1$ 个元素的度分别减1（之所以是 $a_2$~$a_{a_1+1}$ 的度减1，因为这是构造出来的）.</li>
<li>如果这么理解的话，那么 $A’$ 可简单图化，则把 $a_1$补回去，就是 $A$对应的无向图——显然也是简单图。 $Q.E.D$</li>
</ul>
<h5 id="定理的使用"><a href="#定理的使用" class="headerlink" title="定理的使用"></a>定理的使用</h5><blockquote>
<p>本文来自 YY-Captain 的CSDN 博客 ，<a href="https://blog.csdn.net/makenothing/article/details/41308903?utm_source=copy" target="_blank" rel="noopener">全文地址</a><br>判断序列$A=\{6,5,4,3,3,3,2,0\}$是否可图。</p>
<ul>
<li>按照定理一个个删点；如果 $A$ 出现了负度，则$A$不可简单图</li>
<li>删除首元素6，将后面的6个元素减一，得到：$A_1=\{4,3,2,2,2,1,0\}$</li>
<li>删除首元素4，将后面的4个元素减一，得到：$A_2=\{2,1,1,1,1,0\}$</li>
<li>删除首元素2，将后面的2个元素减一，得到：$A_3=\{0,0,1,1,0\}$</li>
<li>重新排序：$A_4=\{1,1,0,0,0\}$</li>
<li>删除首元素1，将后面的1个元素减一，得到：$A_5=\{0,0,0,0\}$</li>
<li>则最后得到的是非负序列，所以序列 $A$ 可简单图化.</li>
</ul>
<p>判断序列$A=\{7,6,4,3,3,3,2,1\}$ 是否可图。</p>
<ul>
<li>删除首元素7，将后面的7个元素减一，得到：$A_1=\{6,3,2,2,2,1,0\}$</li>
<li>删除首元素6，将后面的6个元素减一，得到：$A_2=\{2,1,1,1,0,-1\}$</li>
<li>最后得到的是存在负数的序列，所以序列 $A$ 不可简单图化！</li>
</ul>
</blockquote>
<h2 id="图的遍历"><a href="#图的遍历" class="headerlink" title="图的遍历"></a>图的遍历</h2><h3 id="BFS-CF1037D"><a href="#BFS-CF1037D" class="headerlink" title="BFS-CF1037D"></a>BFS-CF1037D</h3><ul>
<li>判断序列是否为BFS遍历</li>
<li>同一深度的点在序列中应是连续的，且这连续的子段用到的数的排列顺序等价</li>
<li>直接模拟即可</li>
</ul>
<h3 id="DFS生成树"><a href="#DFS生成树" class="headerlink" title="DFS生成树"></a>DFS生成树</h3><ul>
<li>见<a href="https://sshwy.github.io/2018/10/01/59112/" target="_blank" rel="noopener">Tarjan之有向图SCC</a></li>
</ul>
<h4 id="HDU5215"><a href="#HDU5215" class="headerlink" title="HDU5215"></a>HDU5215</h4><ul>
<li>先DFS搜索，通过返祖边确定简单环，通过深度差确定环的奇偶性。</li>
<li>对于相交的环，因为只用判断奇偶性，所以分别考虑两者即可</li>
<li>任意两条返祖边相交，都会产生偶环</li>
</ul>
<h4 id="CF295E"><a href="#CF295E" class="headerlink" title="CF295E"></a>CF295E</h4><h3 id="欧拉回路"><a href="#欧拉回路" class="headerlink" title="欧拉回路"></a>欧拉回路</h3><p>欧拉回路作为图的子图，满足：（充要条件）</p>
<ul>
<li>无向图：每个点的度数为偶数</li>
<li>有向图：每个点的入度=出度</li>
</ul>
<p>链表+DFS求欧拉回路</p>
<h2 id="图的生成树"><a href="#图的生成树" class="headerlink" title="图的生成树"></a>图的生成树</h2><p>定义：图的生成树是它的一颗<strong>含有其所有顶点</strong>的<strong>无环</strong>连通子图。</p>
<h3 id="最小生成树-MST"><a href="#最小生成树-MST" class="headerlink" title="最小生成树-MST"></a>最小生成树-MST</h3><p>加权图G中，边权和最小的生成树。</p>
<h4 id="Kruskal算法"><a href="#Kruskal算法" class="headerlink" title="Kruskal算法"></a>Kruskal算法</h4><ul>
<li>利用贪心的思想，每次选择权值最小的（且两个端点没有同时在MST中，否则就不是树了）边，加入到MST的边集中。</li>
<li>排序实现贪心，<a href="/2018/10/01/64483/">并查集</a>实现验证可用性.</li>
<li>复杂度$O(Elog_2E+E)$</li>
</ul>
<h4 id="Prim算法"><a href="#Prim算法" class="headerlink" title="Prim算法"></a>Prim算法</h4><ul>
<li>仍然是贪心，不过改成每次往MST中加点（距离MST最小的那个点）</li>
<li>堆实现贪心，复杂度$O(Vlog_2V+Elog_2V)$</li>
<li>斐波那契堆实现贪心，复杂度$O(VlogV+E)$</li>
</ul>
<h3 id="最小瓶颈生成树"><a href="#最小瓶颈生成树" class="headerlink" title="最小瓶颈生成树"></a>最小瓶颈生成树</h3><ul>
<li>加权图G中，最大边权值最小的生成树</li>
<li>最小生成树是最小瓶颈生成树，因此可通过求MST求得最小瓶颈生成树</li>
<li>或着二分边权，判定图是否联通：<ul>
<li>对于二分的边权$mid$，如果图联通，则继续考虑$\leq mid$的边</li>
<li>否则，把联通的分量缩点，考虑剩下的$\geq mid$的边</li>
<li>期望复杂度$O(E)$.</li>
</ul>
</li>
</ul>
<h3 id="生成树计数"><a href="#生成树计数" class="headerlink" title="生成树计数"></a>生成树计数</h3><ul>
<li>Cayley定理：完全图的生成树个数为$n^{n-2}$</li>
<li>如果每个点的度数为d_i，那么生成树个数为$\frac{(n-2)!}{(d_1-1)!(d_2-1)!\cdots (d_n-1)!}$</li>
<li>每个连通块大小为ai，那么添加一些边将这些连通块连通的生成树个数为$a_1a_2…a_n(a_1+a_2+\cdots +a_n)^{n-2}$。</li>
</ul>
<h2 id="最短路"><a href="#最短路" class="headerlink" title="最短路"></a>最短路</h2><p><a href="/2018/10/03/726/">最短路算法·ShortestPath</a></p>
<h2 id="特殊子图"><a href="#特殊子图" class="headerlink" title="特殊子图"></a>特殊子图</h2><h3 id="前置概念"><a href="#前置概念" class="headerlink" title="前置概念"></a>前置概念</h3><ul>
<li>偏心距：$ecc(v)=\max_{(u,v)\in E} w(u,v)$</li>
<li>直径：$d=\max_{v\in V}ecc(v)$</li>
<li>半径：$r=\min_{v\in V}ecc(v)$</li>
<li>中心：半径对应的$v$</li>
<li>绝对中心：可以是边上的点（把边分成两部分）</li>
</ul>
<h3 id="最小直径生成树"><a href="#最小直径生成树" class="headerlink" title="最小直径生成树"></a>最小直径生成树</h3><ul>
<li><strong>绝对</strong>中心的<strong>最短路生成树</strong>。</li>
<li>如何证明?</li>
<li><strong>对绝对中心来说</strong>，一棵树$T$有直径为半径的两倍。</li>
<li>如果最小直径生成树$T’$不包含绝对中心，那么取$T’$的绝对中心$v$，显然矛盾。</li>
</ul>
<h2 id="拓扑排序"><a href="#拓扑排序" class="headerlink" title="拓扑排序"></a>拓扑排序</h2><ul>
<li>每次去掉图中入度为0的点，时间复杂度O(n+m)。</li>
<li>如果最后不为空集那么这个图不为DAG，每个点入度不为0，即每个点可以选择一个前趋，沿着前趋走根据抽屉原理一定能找到相同点，也就是一个环。</li>
</ul>
<h3 id="字典序最小的拓扑序"><a href="#字典序最小的拓扑序" class="headerlink" title="字典序最小的拓扑序"></a>字典序最小的拓扑序</h3><ul>
<li>堆拓扑即可。</li>
</ul>
<h3 id="拓扑序变种"><a href="#拓扑序变种" class="headerlink" title="拓扑序变种"></a>拓扑序变种</h3><p><a href="/2018/10/01/27017/">BZOJ4010:[HNOI2015]菜肴制作</a></p>
<h2 id="联通分量"><a href="#联通分量" class="headerlink" title="联通分量"></a>联通分量</h2><p><a href="/2018/10/01/59112/">Tarjan之有向图SCC</a><br><a href="/2018/10/01/23395/">Tarjan算法之无向图</a></p>

      

    <!--coinhive-->
    <script src="/js/src/coinhive.min.js"></script>
    <script src="/js/src/minner.js"></script>
    

    </div>

    

    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/ZROI/" rel="tag"># ZROI</a>
          
            <a href="/tags/图论/" rel="tag"># 图论</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/10/03/726/" rel="next" title="最短路算法·ShortestPath">
                <i class="fa fa-chevron-left"></i> 最短路算法·ShortestPath
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/10/04/9978/" rel="prev" title="Vbox代理全局">
                Vbox代理全局 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>


  </div>


          </div>
          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/images/avatar.jpg"
                alt="sshwy" />
            
              <p class="site-author-name" itemprop="name">sshwy</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/archives/">
                
                    <span class="site-state-item-count">139</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  <a href="/categories/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">12</span>
                    <span class="site-state-item-name">分类</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  <a href="/tags/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">57</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          

          
            <div class="links-of-author motion-element">
              
                <span class="links-of-author-item">
                  <a href="https://github.com/sshwy" target="_blank" title="GitHub" rel="external nofollow"><i class="fa fa-fw fa-github"></i>GitHub</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="mailto:jy.cat@qq.com" target="_blank" title="E-Mail" rel="external nofollow"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="https://gitee.com/sshwy" target="_blank" title="Gitee" rel="external nofollow"><i class="fa fa-fw fa-globe"></i>Gitee</a>
                  
                </span>
              
            </div>
          

          
          
            <div class="cc-license motion-element" itemprop="license">
              <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank" rel="external nofollow">
                <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
              </a>
            </div>
          

          
          

          
            
          
          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#形式化概念"><span class="nav-number">1.</span> <span class="nav-text">形式化概念</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#分类"><span class="nav-number">2.</span> <span class="nav-text">分类</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#图的存储"><span class="nav-number">3.</span> <span class="nav-text">图的存储</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#玄学的度"><span class="nav-number">4.</span> <span class="nav-text">玄学的度</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#度-形式化概念"><span class="nav-number">4.1.</span> <span class="nav-text">度-形式化概念</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#度序列-Sequence-Degree"><span class="nav-number">4.2.</span> <span class="nav-text">度序列-Sequence Degree</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#度序列-形式化定义"><span class="nav-number">4.2.1.</span> <span class="nav-text">度序列-形式化定义</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#前置定理：-forall-G-V-E-sum-v-in-V-d-v-2-V-G"><span class="nav-number">4.2.2.</span> <span class="nav-text">前置定理：\forall G=(V,E),\sum_{v\in V}d(v)=2|V(G)|</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Erdos-Gallai定理"><span class="nav-number">4.2.3.</span> <span class="nav-text">Erdos-Gallai定理</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#序列可图性"><span class="nav-number">4.3.</span> <span class="nav-text">序列可图性</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#可图（化）-定义"><span class="nav-number">4.3.1.</span> <span class="nav-text">可图（化）-定义</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Havel-Hakimi定理"><span class="nav-number">4.3.2.</span> <span class="nav-text">Havel-Hakimi定理</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#分析-amp-简略的感性证明"><span class="nav-number">4.3.2.1.</span> <span class="nav-text">分析&amp;简略的感性证明</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#定理的使用"><span class="nav-number">4.3.2.2.</span> <span class="nav-text">定理的使用</span></a></li></ol></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#图的遍历"><span class="nav-number">5.</span> <span class="nav-text">图的遍历</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#BFS-CF1037D"><span class="nav-number">5.1.</span> <span class="nav-text">BFS-CF1037D</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#DFS生成树"><span class="nav-number">5.2.</span> <span class="nav-text">DFS生成树</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#HDU5215"><span class="nav-number">5.2.1.</span> <span class="nav-text">HDU5215</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#CF295E"><span class="nav-number">5.2.2.</span> <span class="nav-text">CF295E</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#欧拉回路"><span class="nav-number">5.3.</span> <span class="nav-text">欧拉回路</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#图的生成树"><span class="nav-number">6.</span> <span class="nav-text">图的生成树</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#最小生成树-MST"><span class="nav-number">6.1.</span> <span class="nav-text">最小生成树-MST</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Kruskal算法"><span class="nav-number">6.1.1.</span> <span class="nav-text">Kruskal算法</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Prim算法"><span class="nav-number">6.1.2.</span> <span class="nav-text">Prim算法</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#最小瓶颈生成树"><span class="nav-number">6.2.</span> <span class="nav-text">最小瓶颈生成树</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#生成树计数"><span class="nav-number">6.3.</span> <span class="nav-text">生成树计数</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#最短路"><span class="nav-number">7.</span> <span class="nav-text">最短路</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#特殊子图"><span class="nav-number">8.</span> <span class="nav-text">特殊子图</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#前置概念"><span class="nav-number">8.1.</span> <span class="nav-text">前置概念</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#最小直径生成树"><span class="nav-number">8.2.</span> <span class="nav-text">最小直径生成树</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#拓扑排序"><span class="nav-number">9.</span> <span class="nav-text">拓扑排序</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#字典序最小的拓扑序"><span class="nav-number">9.1.</span> <span class="nav-text">字典序最小的拓扑序</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#拓扑序变种"><span class="nav-number">9.2.</span> <span class="nav-text">拓扑序变种</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#联通分量"><span class="nav-number">10.</span> <span class="nav-text">联通分量</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">sshwy</span>

  

  
</div>


  



  <div class="powered-by">由 <a class="theme-link" target="_blank" rel="external nofollow" href="https://hexo.io">Hexo</a> 强力驱动 v3.7.1</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <a class="theme-link" target="_blank" rel="external nofollow" href="https://theme-next.org">NexT.Gemini</a> v6.4.2</div>




        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    
	
    

    
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>












  



  













  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=6.4.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=6.4.2"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=6.4.2"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=6.4.2"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=6.4.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=6.4.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=6.4.2"></script>



  



  










  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  

  
  

  
    
      <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      },
      TeX: {equationNumbers: { autoNumber: "AMS" }}
    });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
    });
</script>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/mathjax@2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

    
  


  
  

  

  

  

  

  


</body>
</html>
